count( ) Function is used to specify the number of times an element is present in the Tuple.
Let us say, we have a Tuple that contains three names, 'Mohan', 'Kriti' and 'Salim'. And we want to find how many times 'Mohan' is present in the Tuple.
x = ("Mohan", "Kriti", "Mohan", "Salim") y = x.count("Mohan") print("The count of Mohan is ",y)
So, in the above code we have created a 'Tuple' and initialised to the variable 'x'.
Below is how the values are positioned in the Tuple,
Now, if we see the above diagram, 'Mohan' is present '2' times in the above Tuple.
And the 'count( )' Function is used to find how many times 'Mohan' is present.
And we get the below output,